package cn.com.jenson.convert;

import cn.com.jenson.util.ListUtil;

import javax.persistence.AttributeConverter;
import java.util.List;

public class StringListConcert implements AttributeConverter<List<String>, String> {
    @Override
    public String convertToDatabaseColumn(List<String> stringList) {
        return ListUtil.stringListToString(stringList);
    }

    @Override
    public List<String> convertToEntityAttribute(String s) {
        return ListUtil.stringToStringList(s);
    }
}
